package cn.iocoder.yudao.module.dlbz.dal.mysql.companyemployee;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.dlbz.dal.dataobject.companyemployee.CompanyEmployeeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.dlbz.controller.admin.companyemployee.vo.*;

/**
 * 企业员工 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface CompanyEmployeeMapper extends BaseMapperX<CompanyEmployeeDO> {

    default PageResult<CompanyEmployeeDO> selectPage(CompanyEmployeePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CompanyEmployeeDO>()
                .eqIfPresent(CompanyEmployeeDO::getCompanyId, reqVO.getCompanyId())
                .eqIfPresent(CompanyEmployeeDO::getPostId, reqVO.getPostId())
                .likeIfPresent(CompanyEmployeeDO::getName, reqVO.getName())
                .eqIfPresent(CompanyEmployeeDO::getPhone, reqVO.getPhone())
                .eqIfPresent(CompanyEmployeeDO::getImg, reqVO.getImg())
                .eqIfPresent(CompanyEmployeeDO::getOpenid, reqVO.getOpenid())
                .eqIfPresent(CompanyEmployeeDO::getScore, reqVO.getScore())
                .betweenIfPresent(CompanyEmployeeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CompanyEmployeeDO::getId));
    }

}